package main

import (
	"fmt"
	"math"
)

func Sqrt(x float64) float64 {
	var i int = 0
	var z float64 = 1.0
	for ; i < 10; i++{
		z -= (z*z - x) / (2 * z)
		fmt.Printf("res: %v \n", z)
	}
	return z
}

func main() {
	fmt.Println(Sqrt(2))
	fmt.Println(math.Sqrt(2))
}